package com.xiaoshi.utils;

import com.xiaoshi.exception.PlatformException;
import com.xiaoshi.interfaces.MyHttpServiceMsg;

import java.math.BigDecimal;

public class BigDecimalUtils {

    /**
     * 类型变成bigdecimal
     * @param obj
     * @return
     */
    public static BigDecimal  parseBigDecimal (Object obj){
        if(!ResUtil.isBasicsType(obj)) throw  PlatformException.platEXformat( MyHttpServiceMsg.MSG_CANNOT_CHANGE_BIGDECIMAL,obj.getClass());
        return new BigDecimal(String.valueOf(obj));
    }
}
